update
[archive.git] / asche_0 (Case Conflict 1) / code / SH / volume
blobfd31fc59ace712f19cd6cdbb5648c58b7d318a28
1 #!/bin/bash
3 if [ "$1" = "" ]; then
5 exit
7 elif [ "$1" = "mute" ]; then
9 if [ "`amixer get PCM | grep off -o | uniq`" = "off" ]; then
10 amixer set PCM unmute &>/dev/null
11 else
12 amixer set PCM mute &>/dev/null
15 elif [ "`echo $1 | grep + -o`" = "+" ]; then
17 vol=`echo $1 | grep -P "\d{1,}" -o`
18 amixer set PCM $vol"%+" unmute &>/dev/null
20 elif [ "`echo $1 | grep - -o`" = "-" ]; then
22 vol=`echo $1 | grep -P "\d{1,}" -o`
23 amixer set PCM $vol"%-" unmute &>/dev/null
25 else
27 amixer set PCM $1"%" unmute &>/dev/null